<?php

class Model_News extends Joob_Db_Table	{
	
	protected $key = "id";
	
	protected $db = "news";
	
	public static function getNewsList($page,$page_size=30)	{
		$model = new Model_News();
		return $model->search('', 'id, news_title,content, since', $page*$page_size.','.$page_size, 'id ASC');
	}
	
	public function getNewsDetail(){
		return array('id'=>$this->id, 'news_title'=>$this->news_title, 'content'=>$this->content,
				'since'=>$this->content
		);
	}
	
	public function addNew()	{
		return $this->insert('news_title,content,since');
	}
	
	public function updateNews()	{
		return $this->edit('news_title, content');
	}
}

?>